﻿using System;

namespace Skynet.CommonLibrary.ExceptionEx.Inteface
{
    public interface ILogHandler
    {
        /// <summary>
        /// 将日志保存到数据库中
        /// </summary>
        /// <param name="datasource"> </param>
        /// <param name="ex">异常</param>
        /// <param name="friendlyInfo">友好提示信息</param>
        /// <param name="exType">异常类型</param>
        /// <returns>异常编号</returns>
        ExceptionEntity SaveLogInfo(IExceptionDataSource datasource, Exception ex, string friendlyInfo, string exType);

        /// <summary>
        /// 通过异常编号查找异常，如果不存在。则已此为编号存储到数据库中
        /// </summary>
        /// <param name="datasource"></param>
        /// <param name="ex">异常</param>
        /// <param name="exid">异常编号</param>
        /// <returns>返回异常实体</returns>
        ExceptionEntity FindLogInfo(IExceptionDataSource datasource, Exception ex, int exid);
    }
}
